/**
 * Controller
 * The Controller class is part of the MVC design pattern.
 * Use this class to handle all user initiated events from the view.
 * This is an abstract class and is meant to be extended.
 *
 * @author		Craig Phares
 * @version		3.3
 */
package com.rad.mvc {

	public class Controller implements IController {
		
		private var _model:IModel;	// the model - used for data manipulation
		private var _view:IView;	// the view - used for data views and controls
	
		/**
		 * Creates an instance of the Controller class.
		 * Passes and saves the model for the MVC unit.
		 *
		 * @param m		the model to modify after logic is applied
		 */
		public function Controller(m:IModel = null) { setModel(m); }
		
		/**
		 * Retrieves the model.
		 *
		 * @return		the model being used
		 */
		public function getModel():IModel { return _model; }

		/**
		 * Saves the model.
		 *
		 * @param m		the model to save
		 */
		public function setModel(m:IModel):void { _model = m; } 
	
		/**
		 * Retrieves the view.
		 *
		 * @return		the view
		 */
		public function getView ():IView { return _view; }
	
		/**
		 * Saves the view.
		 *
		 * @param v		the view from which to receive events
		 */
		public function setView(v:IView):void { _view = v; }
	
	}

}